[[PageOutline(3-4, Sections)]]
== !SubtitlesVote ==
=== Intro ===
rate subtitles
----
=== Description ===
'''struct !SubtitlesVote(string $token, struct('idsubtitle' => int $idsubtitle, 'score' => int $score) $vote)'''
allows registered users to rate subtitle ''idsubtitle'' giving a score ''score'' where 1 is worst and 10 is best.
users cannot rate subtitles they uploaded and each user can rate a specific subtitle only once.
----
=== Parameters ===
Parameters structure:
{{{
struct(
(string) [token],
struct(
(string) [idsubtitle],
(double) [score]
)
)
}}}
''token (required)''::
token string identifying user's session, taken from [wiki:XmlRpcLogIn LogIn] output structure.
''vote (required)''::
structure to rate (cast a vote) a subtitle contains:
* ''idsubtitle'': id of subtitle (NOT subtitle file) user wants to rate
* ''score'': subtitle rating, must be in interval 1 (worst) to 10 (best).
----
=== Return Values ===
Output is returned in this structure:
{{{
struct(
(string) [status],
struct(
(string) [SubRating],
(string) [SubSumVotes],
(string) [IDSubtitle]
) [data],
(double) [seconds]
)
}}}
and contains these elements:
''status''::
function result code, see [wiki:XmlRpcStatusCode list of status codes]
''data''::
* ''!SubRating'': average subtitle rating for given subtitles
* ''!SubSumVotes'': number of times these subtitles were rated.
* ''IDSubtitle'': ID of subtitle in the database (BEWARE this is not the ID of subtitle file but the whole subtitle)
''seconds''::
time taken to execute this command on server
----
=== Implementations ===
There are currently no available sample implementations.
----
=== Changelog ===
Version 1: created this function
----
=== Examples ===
==== Input ====
{{{
#!xml
SubtitlesVote
e13niph67doilhse1me3kb43e4
idsubtitle
3337934
score
10
}}}
==== Output ====
{{{
#!xml
status
200 OK
data
SubRating
10.0
SubSumVotes
1
IDSubtitle
3337934
seconds
5.243
}}}
----
=== Notes ===
none yet
----
=== See also ===
----
=== Comments ===
add your comments, hints and suggestions here if you like ...
--------
[Prev] [wiki:XmlRpcIntro Home] [Next]